package cn.gxufe.reliable.message.api.consumer.impl;

import cn.gxufe.reliable.message.api.common.BaseTryService;
import cn.gxufe.reliable.message.api.consumer.TryServiceConsumer;
import cn.gxufe.reliable.message.common.Message;
import cn.gxufe.reliable.message.common.ResultVo;

/**
 * @author yingjie.rong
 **/
public class TryServiceConsumerImpl  extends BaseTryService implements TryServiceConsumer {


    @Override
    public ResultVo finishOrCancel(Long messageId, String key, String header) {
        int anInt =  getStatus(messageId,key,header, Message.TARGET_SERVICE_KEY_PREFIX);
        if( anInt == -1 ) {
            return ResultVo.error(Message.RESPONSE_CODE_NOT_FOUNT,"not found");
        }
        return ResultVo.ok(String.valueOf(anInt));
    }

}
